/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package puzzle_mch;

import java.util.Scanner;

/**
 *
 * @author Maria
 */
public class Main {

    static String value;
    public String string_value;
    public Scanner in = new Scanner(System.in);
private puzzle [][] initialState ;
    public static void main(String args[]) {

        printBoard();
        puzzle init =  new puzzle();
        //System.out.println ("Enter (2, 0) coordinate value for start configuration :");
        for (Integer i = 2; i >= 0; i = i - 1) {
            for (Integer j = 0; j <= 2; j++) {
                System.out.println("Enter (" + i + "," + j + ") coordinate value between 0 and 9for start configuration : ");
                Scanner keyboard = new Scanner(System.in);

                String value = keyboard.next();

                if (Integer.parseInt(value) < 0 || Integer.parseInt(value) > 9) {
                    System.out.println("the value is not valid");
                    System.out.println("Enter (" + i + "," + j + ") coordinate value between 0 and 9for start configuration : ");
                    value = keyboard.next();
                }
                init.setPosition_x(i);
                        init.setPosition_y(j);
                        init.setValue(Integer.parseInt(value));
            }
        }

    }


    public static void printBoard() {
        System.out.println("Please insert the start state :");
        System.out.println("-------------------");
        System.out.println("|(2,0)|(2,1)|(2,2)| ");
        System.out.println("|-----|-----|-----|");
        System.out.println("|(1,0)|(1,1)|(1,2)| ");
        System.out.println("|-----|-----|-----|");
        System.out.println("|(0,0)|(0,1)|(0,2)| ");
        System.out.println("-------------------");

    }
}
